package com.wetao.lib_common.utils;

import android.content.Context;
import android.content.Intent;

import com.alibaba.android.arouter.launcher.ARouter;
import com.wetao.lib_common.ConstantArouter;
import com.wetao.lib_common.Constants;
import com.wetao.lib_common.net.cookies.CookiesManager;

/**
 * author: zhouyh
 * created on: 3/10/21 5:49 PM
 * description: 重新绑定设备
 */
public class RestartBindUtils {

    /**
     * Token过期重新绑定
     * @param context
     */
    public static void reBindDevice(final Context context){
        CookiesManager.clearAllCookies();
        SPUtils.getInstance().put(Constants.HEAD_XTOKEN,"");
        SPUtils.getInstance().put(Constants.USER_ID_KEY,"");
        //SPUtils.getInstance().put(Constants.USER_ID_LIST,"");
        ARouter.getInstance().build(ConstantArouter.PATH_APP_HOMEACTIVITY)
                .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK)
                .navigation();
    }
}
